﻿<environment names="Development">
    <!-- jQuery相关引用 -->
    <script type="text/javascript" src="~/lib/YdmJUI/static/plugins/jquery/jquery2/jquery-2.2.1.min.js"></script>
    <script src="~/lib/layer/layer.js"></script>
    <script type="text/javascript" src="~/lib/YdmJUI/static/plugins/jquery/jquery.cookie.js"></script>
    <script src="~/lib/jquery-loadmask/jquery.loadmask.min.js"></script>
    <script src="~/lib/YdmJUI/static/plugins/jquery/jquery.tmpl.min.js"></script>
    <!--自定义引入-->
    <script src="~/lib/Ydm/Ydm.js" asp-append-version="true"></script>
    <!-- TopJUI框架核心 -->
    <script type="text/javascript" src="~/lib/YdmJUI/static/public/js/topjui.config.js"></script>
    <!-- TopJUI框架核心 -->
    <script type="text/javascript" src="~/lib/YdmJUI/topjui/js/topjui.core.min.js" asp-append-version="true"></script>

    <!-- TopJUI中文支持 -->
    <script type="text/javascript" src="~/lib/YdmJUI/topjui/js/locale/topjui.lang.zh_CN.js"></script>
    <script type="text/javascript" src="~/lib/YdmJUI/static/plugins/layui/layui.js"></script>

    <!--abp引入-->
    <script src="~/lib/abp-web-resources/abp.js"></script>
    <script type="text/javascript" src="~/lib/abp-web-resources/libs/abp.jquery.js"></script>
    <script type="text/javascript" src="~/lib/abp-web-resources/libs/abp.layer.js"></script>
    <script src="/AbpScripts/GetScripts" type="text/javascript"></script>

    <!--第三方帮助类-->
    <script src="~/lib/moment/moment.min.js"></script>
    <script src="~/lib/lodash/lodash.min.js"></script>

    <!-- TopJUI框架配置 -->
    <script src="~/lib/easyui-helper/easyui-helper.js" asp-append-version="true"></script>
</environment>

<environment names="Staging,Production">
    <!--公共js-->
    <script src="~/lib/jui/Js/jui.min.js" asp-append-version="true"></script>
    <script src="/AbpScripts/GetScripts" type="text/javascript"></script>
    <script type="text/javascript" src="~/lib/YdmJUI/static/plugins/layui/layui.js"></script>
</environment>

<script>
 /**
 * 更换页面风格
 * param topjuiThemeName
 */
function changeTheme(themeName) {/* 更换主题 */
    var $dynamicTheme = $('#dynamicTheme');
    var themeHref = $dynamicTheme.attr('href');
    var themeHrefNew = themeHref.substring(0, themeHref.indexOf('themes')) + 'themes/default/topjui.' + themeName + '.css';
    // 更换主页面风格
    $dynamicTheme.attr('href', themeHrefNew);

    // 更换iframe页面风格
    var $iframe = $('iframe');
    if ($iframe.length > 0) {
        for (var i = 1; i < $iframe.length; i++) {
            var ifr = $iframe[i];
            var $iframeDynamicTheme = $(ifr).contents().find('#dynamicTheme');
            var iframeThemeHref = $iframeDynamicTheme.attr('href');
            if (iframeThemeHref != undefined) {
                var iframeThemeHrefNew = iframeThemeHref.substring(0, iframeThemeHref.indexOf('themes')) + 'themes/default/topjui.' + themeName + '.css';
                $iframeDynamicTheme.attr('href', iframeThemeHrefNew);
            }
        }
    }

    $.cookie('topjuiThemeName', themeName, {
        expires: 7,
        path: '/'
    });
};
if ($.cookie('topjuiThemeName')) {
    changeTheme($.cookie('topjuiThemeName'));
}
</script>